﻿<%@ Page Title="DisplayListings" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="DisplayListings.aspx.cs" Inherits="RoomService.Listings.DisplayListings" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    <style type="text/css">
        .style2
        {
            height: 34px;
        }
    </style>

    <script type="text/javascript">
$("#btnAddStudentToDepartment").click(function () {
            if (jDepartment == null) {
                alert("Please wait until the department loads");
                return;
            }
            if (jPendingStudent == null) {
                alert("Please first get a new student to add to the department");
                return;
            }
 
            var jData = {};
            jData.department = jDepartment;
            jData.student = jPendingStudent;
 
            $.ajax({
                cache: false,
                type: "POST",
                async: false,
                url: AddStudentToDepartment,
                data: JSON.stringify(jData),
                contentType: "application/json",
                dataType: "json",
                success: function (department) {
                    jPendingStudent = null;
                    jDepartment = department;
 
                    var table = makeTable(department.Students);
                    $("#divStudentList").html("").append(table);
                    $("#divNewStudent").hide();
                },
                error: function (xhr) {
                    alert(xhr.responseText);
                }
            });
        });
    });
</script>

</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<section id="forms">
  <div class="page-header">
    <h1>Listings</h1>
  </div>
  <form class="form-horizontal well span5 offset5">
        <fieldset id ="txt_listings">
          <legend>Register</legend>
          <div class="span4">
            <h3>Listings</h3>
            <asp:Table ID = "table1" runat="server" class="table table-bordered table-striped" BorderStyle="Solid" Height="200" Width="439" >
            
            </asp:Table>

           </div>
        </fieldset>
    </form>

    
   <asp:label id="lblMessage" runat="server" width="288px" font-bold="True" font-italic="True"
            font-size="Medium" forecolor="#C00000"></asp:label>

</section>
</asp:Content>
